import AlipaySdk from 'alipay-sdk';
import { appid, private_key, sign_type } from './config';

export default async function get_user_info(auth_token: string) {
	return new Promise(async (resolve, _reject) => {
		const ali = new AlipaySdk({
			appId: appid,
			privateKey: private_key,
			signType: sign_type
		});
		const res = await ali.exec('alipay.fund.auth.order.app.freeze', {
			bizContent: {
				out_order_no: "o2018112100001",
				out_request_no: "r2018112100001",
				order_title: "测试商品",
				amount: "0.01",
				product_code: "PRE_AUTH_ONLIN"
			}
		});
		resolve(res)
	});
}
